<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="js/jquery-min.js" type="text/javascript"></script>
    <script src="js/getUsers.js" type="text/javascript"></script>
    <script src="js/getMissions.js" type="text/javascript"></script>
    <script>

    </script>
    <link rel="stylesheet" href="css/rankingList.css">
    <title>Document</title>
</head>
<body>
    <div id="navgation">
        <a href="./index.html"><span> <</span></a>
        <p class="ranking">排行榜</p>
    </div>
    <div id="content">
		<div class="information">
			<p class='rankingIndex'>排名</p><p class='personNumber'>学号</p>&nbsp;&nbsp;&nbsp;<p class='person'>姓名</p><span class='lovingValue'>能量值</span>
		</div>
		<!--<div class="information">-->
			<!--<p class='rankingIndex'>1</p><p class='personNumber'>20185399</p><p class='person'>牛梓雨</p><span class='lovingValue'>1000</span>-->
		<!--</div>-->
    </div>

</body>
<script>
    orderUser();
</script>
<script>
    var content = document.getElementById("content");
    function createRank(rankingIndex,personNumber,person,lovingValue){
        var rankingDiv = document.createElement("div");
        rankingDiv.className = "information";
        rankingDiv.innerHTML = "<p class='rankingIndex'>"+rankingIndex+"</p><p class='personNumber'>"+personNumber+"</p><p class='person'>"+person+"</p><span class='lovingValue'>"+lovingValue+"</span>";
        content.appendChild(rankingDiv);
        return rankingDiv;
    }

    var userList=getCookie("UserResults");
    userList=JSON.parse(userList);
    for(var i=0;i<userList.length;i++){
        createRank(i+1,userList[i].number,userList[i].name,userList[i].energy);
    }
</script>
</html>